DROP TABLE IF EXISTS jms_ods.yl_tmsnew_tms_track;
CREATE EXTERNAL TABLE jms_ods.yl_tmsnew_tms_track(
 ID bigint comment "主键",  --NUMBER(11)
 SHIPMENT_ID bigint comment "任务ID",  --NUMBER(20)
 SHIPMENT_NO string comment "任务号",  --NVARCHAR2(30)
 SHIPMENT_NAME string comment "任务名称",  --NVARCHAR2(100)
 VEHICLELINE_NAME string comment "线路名称",  --NVARCHAR2(100)
 TRACK_TYPE bigint comment "签到类型",  --NUMBER(11)
 PLATE_NUMBER string comment "车牌号",  --NVARCHAR2(30)
 TRAILER_NUMBER string comment "挂车号",  --NVARCHAR2(30)
 SORT_NUM bigint comment "经停序号",  --NUMBER(11)
 NETWORK_ID bigint comment "站点ID",  --NUMBER(11)
 NETWORK_CODE string comment "站点编码",  --NVARCHAR2(30)
 NETWORK_NAME string comment "站点名称",  --NVARCHAR2(60)
 SIGN_TIME timestamp comment "打卡时间",  --DATE
 LONGITUDE string comment "经度",  --NVARCHAR2(60)
 LATITUDE string comment "纬度",  --NVARCHAR2(60)
 PHONE string comment "手机号",  --NVARCHAR2(60)
 OPENID string comment "微信OPENID",  --NVARCHAR2(60)
 SOURCE string comment "来源WEIXIN/ANDROIDAPP/IOSAPP",  --NVARCHAR2(60)
 SUPPLEMENT smallint comment "签补卡 1 正常签卡 0 正常补卡 2 微信补卡 3 JMS补卡",  --NUMBER(4)
 PROCESS_STATUS smallint comment "处理状态 1正常 0初始",  --NUMBER(4)
 CREATE_BY bigint comment "创建人ID",  --NUMBER(11)
 CREATE_BY_NAME string comment "创建人姓名",  --NVARCHAR2(20)
 CREATE_TIME timestamp comment "创建时间",  --DATE
 UPDATE_BY bigint comment "",  --NUMBER(11)
 UPDATE_BY_NAME string comment "",  --NVARCHAR2(20)
 UPDATE_TIME timestamp comment "",  --DATE
 FINANCIAL_CENTER_CODE string comment "所属代理区code",  --NVARCHAR2(30)
 FINANCIAL_CENTER_DESC string comment "所属代理区名称",  --NVARCHAR2(60)
 DRIVER_NAME string comment "司机的名称",  --NVARCHAR2(64)
 DEVICE_ID string comment "手机设备号",  --NVARCHAR2(64)
 LINE_TYPE tinyint comment "线路类型 1干线 2支线"  --NUMBER(1)
 )
 COMMENT '运单变化记录表'
 PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
 STORED AS PARQUET
 LOCATION '/dw/hive/jms_ods.db/external/yl_tmsnew_tms_track'
 TBLPROPERTIES (
 'discover.partitions'='false',
 'parquet.column.index.access'='true'
 );

MSCK REPAIR TABLE jms_ods.yl_tmsnew_tms_track;